<!-- 现场勘探 -->
<template>
   <div style="position:relative">
    <div class="out-div"  v-show="modelMap" style="position:absolute;z-index:1000;width:1100px;background-color:white;left:1%;top:15%;">
           <p  style="height:30px;margin-top:20px;position:relative">
                  <i style="position:absolute;right:15px;font-size: 20px;top:-3px;cursor:pointer" @click="modelMap=false" class="el-icon-close"></i>
                  <span style="margin-right:100px">
                     <label>搜索：<input id="diming" placeholder="请输入地名"></label>
                      <Button type="primary" @click="queding2">确定</Button>
                     <input id="lngs" v-model="input.lng" placeholder="请输入经度">
                     <input id="lats" v-model="input.lat" placeholder="请输入纬度">
                      <Button type="primary" @click="queding">确定</Button>
                  </span>
                  <RadioGroup type='button' size='small' v-model="linearBtn" @on-change='mapSelect'>
                    <Radio label='非线性工程'></Radio>
                    <Radio label='线性工程'>线性工程</Radio>
                    
                  </RadioGroup>
                  <!-- <span @click="quanping">全屏显示</span> -->
                   <RadioGroup type='button' size='small' >
                    <Button type="primary" @click="quanping">全屏显示</Button>
                  </RadioGroup>


                   <!-- <span style="margin-right:100px">
                     <label>搜索：<input id="diming" placeholder="请输入地名"></label>
                      <Button type="primary" @click="queding2">确定</Button>
                     <input id="lngs" placeholder="请输入经纬度">
                     <input id="lats" placeholder="请输入经纬度">
                      <Button type="primary" @click="queding">确定</Button>
                  </span>
                  <RadioGroup type='button' size='small' v-model="linearBtn" @on-change='mapSelect'>
                    <Radio label='非线性工程'></Radio>
                    <Radio label='线性工程'>线性工程</Radio>
                  </RadioGroup>
                   <RadioGroup type='button' size='small' >
                    <Button type="primary" @click="quanping">全屏显示</Button>
                  </RadioGroup> -->



                </p>
                  <div @click="tuichu" id="quan" class="tuichu">退出全屏</div>
                    <div id="allmap">
                      <baidu-map 
                      class="bdmap" 
                      :center="center" 
                      :zoom="6" 
                     style="width:100%;height:100%;" 
                     
                      mapType="BMAP_HYBRID_MAP"
                      :scroll-wheel-zoom="true" 
                      @rightclick="newMarker"
                      @moving="syncCenterAndZoom"
                      @moveend="syncCenterAndZoom"
                      >
                      <bm-local-search zoom="12.8" :keyword="keyword" :auto-viewport="true" style="display: none"></bm-local-search>
                      <bm-marker v-if="hpbol" :position="circlePath.center" :dragging="true" animation="BMAP_ANIMATION_BOUNCE"> </bm-marker>
                      <bm-navigation anchor="BMAP_ANCHOR_TOP_RIGHT"></bm-navigation>
                      <bm-marker
                        :position="m.position"
                        :opacity="m.opacity"
                        :dragging="true"
                        :draggable="m.draggable"
                        :clickable='true'
                        @click="center=m.position"
                        v-for="(m,index) in markers"
                        :key="index">
                      </bm-marker>
                  </baidu-map>
                </div>
                    <!-- <div id="allmap">
                <baidu-map map-type-id="hybrid"  :center="center" :zoom="zoom" @rightclick="newMarker" style="height: 600px;width:800px;margin:0 auto;"  mapType="BMAP_HYBRID_MAP" :scroll-wheel-zoom = true @moving="syncCenterAndZoom"
                    @moveend="syncCenterAndZoom" @zoomend="syncCenterAndZoom">
                    <bm-map-type :map-types="['BMAP_NORMAL_MAP', 
                        'BMAP_HYBRID_MAP']" anchor="BMAP_ANCHOR_TOP_LEFT"></bm-map-type>
                    <bm-local-search :keyword="keyword" :auto-viewport="true" style="display: none"></bm-local-search>
                     <bm-navigation anchor="BMAP_ANCHOR_TOP_RIGHT"></bm-navigation>
                    <bm-marker
                      :position="m.position"
                      :opacity="m.opacity"
                      :draggable="m.draggable"
                      :clickable='true'
                      @click="center=m.position"                
                      v-for="(m,index) in markers"
                      :key="index">
                    </bm-marker>
                </baidu-map>
                </div> -->
      </div>
    <card :bordered="false">
      <p slot="title">现场踏勘</p>
      <Form ref="form" :model="info" :rules="rules">
        <table v-if="!loading" id="reconnaissanceTrip" width='100%' border="1" cellspacing="0" cellpadding="0" ref="print">
          <tr>
            <th colspan="4">现场踏勘表</th>
          </tr>
          <tr>
            <td width="25%">项目编号</td>
            <td colspan="3" class='sizeStyle'>
              {{info.ProjectNumber}}
            </td>
          </tr>
          <tr>
            <td width="25%">
              <Icon type="ios-medical" color="#ff6868" />
              项目名称
            </td>
            <td colspan="3" class='sizeStyle'>
              {{info.ProjectName}}
              <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'projectName')" v-if='projectNameList.length>0'/>
              <Oldname v-if="projectName" :oldName="projectNameList"></Oldname>
              <!-- <FormItem prop="Project_name">
                <Input v-model="info.Project_name" />
              </FormItem> -->
              
            </td>
          </tr>
          <tr>
            <td width="25%">
              <Icon type="ios-medical" color="#ff6868" />
              建设单位
            </td>
            <td colspan="3">
              <FormItem prop="BuildUnit">
                <Input v-model="info.BuildUnit" :disabled='viewOnly'/>
              </FormItem>
              <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'buildName')" v-if='buildNameList.length>0'/>
              <Oldname v-if="buildName" :oldName="buildNameList"></Oldname>
            </td>
          </tr>
          <tr>
            <td width="25%">
              法人
            </td>
            <td width="25%">
              <Input v-model="info.LegalPerson" />
              <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'LegalPerson')" v-if='LegalPersonList.length>0'/>
              <Oldname v-if="LegalPerson" :oldName="LegalPersonList"></Oldname>
            </td>
            <td width="25%">
              <Icon type="ios-medical" color="#ff6868" />
              联系人
            </td>
            <td width="25%">
              <FormItem prop="Linkman">
                <Input v-model="info.Linkman" :disabled='viewOnly'/>
              </FormItem>
              <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'Linkman')" v-if='LinkmanList.length>0'/>
              <Oldname v-if="Linkman" :oldName="LinkmanList"></Oldname>
            </td>
          </tr>
          <tr>
            <td width="25%">
              通讯地址
            </td>
            <td colspan="3" class='sizeStyle'>
              {{info.MailAddress}}
              <!-- <Input v-model="info.Mail_address" /> -->
            </td>
          </tr>
          <tr>
            <td width="25%">
              <Icon type="ios-medical" color="#ff6868" />
              联系电话
            </td>
            <td width="25%">
              <FormItem prop="TelNumber">
                <Input v-model="info.TelNumber" :disabled='viewOnly'/>
              </FormItem>
              <Icon type="ios-arrow-down" size='15' style="cursor:pointer" @click="viewClick($event,'telnumberName')" v-if='telnumberNameList.length>0'/>
              <Oldname v-if="telnumberName" :oldName="telnumberNameList"></Oldname>
            </td>
            <td width="25%">邮政编码</td>
            <td>
             <FormItem prop='MailZipCode'>
              <Input v-model="info.MailZipCode" :disabled='viewOnly'></Input>
            </FormItem>
            </td>
          </tr>
          <tr>
            <td width="25%">
              <Icon type="ios-medical" color="#ff6868" />
              建设地点
            </td>
            <td colspan="3" class='sizeStyle'>
              {{info.BuildAddress}}
              <!-- <FormItem prop="Build_address">
                <Input v-model="info.Build_address" />
              </FormItem> -->
            </td>
          </tr>
          <tr>
            <td width="25%">
              立项审批部门
            </td>
            <td>
              <Input v-model="info.ProjectApprovalUnit" :disabled='viewOnly'/>
            </td>
            <td>项目代码</td>
            <td>
              <Input v-model="info.ProjectCode" :disabled='viewOnly'/>
            </td>
          </tr>
          <tr>
            <td>
              建设性质
            </td>
            <td class='sizeStyle'>
              {{info.BulidProperty}}
              <!-- <Input v-model="info.Bulid_property" /> -->
            </td>
            <td>国民经济行业类型</td>
            <td class='sizeStyle'>
              {{info.EconomyIndustryType}}
              <!-- <Input v-model="info.Economy_industry_type" disabled /> -->
            </td>
          </tr>
          <tr>
            <td>占地面积（平方米）</td>
            <td>
              <FormItem prop="FloorSpace">
              <Input v-model="info.FloorSpace" :disabled='viewOnly'></Input>
            </FormItem>
            </td>
            <td>绿化面积（平方米）</td>
            <td>
              <FormItem prop="GreenSpace">
              <Input v-model="info.GreenSpace" :disabled='viewOnly'></Input>
            </FormItem>
            </td>
          </tr>
          <tr>
            <td>总投资（万元）</td>
            <td>
             <FormItem prop="TotalInvestment">
              <Input v-model="info.TotalInvestment" :disabled='viewOnly'></Input>
            </FormItem>
            </td>
            <td>环评合同额（万元）</td>
            <td>
              <FormItem prop="ContractAmount">
              <Input v-model="info.ContractAmount" :disabled='viewOnly'></Input>
            </FormItem>
            </td>
          </tr>
          <tr>
            <td>
              土地文件
            </td>
            <td>
              <Col span="12"><UploadFile v-model="info.LandDoc" :upName="upInfo.tdName" UploadFileName="LandDoc" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
              <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.LandDoc"></DownloadButton></Col>
            </td>
            <td>
              <Icon type="ios-medical" color="#ff6868" />
              土地相符性</td>
            <td class='sizeStyle'>
              {{info.LandConformity}}
            </td>
          </tr>
          <tr>
            <td>
              规划文件</td>
            <td>
              <Col span="12"><UploadFile v-model="info.PlanningDoc" :upName="upInfo.ghName" UploadFileName="PlanningDoc" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
              <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.PlanningDoc"></DownloadButton></Col>
            </td>
            <td>
              <Icon type="ios-medical" color="#ff6868" />
              规划相符性</td>
            <td class='sizeStyle'>
              {{info.PlanningConformity}}
            </td>
          </tr>
          <tr>
            <td>
              立项文件</td>
            <td>
              <Col span="12"><UploadFile v-model="info.CreateProjectDoc" :upName="upInfo.lxName" UploadFileName="CreateProjectDoc" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
              <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.CreateProjectDoc"></DownloadButton></Col>
            </td>
            <td>可研/项目计划书</td>
            <td>
              <Col span="12"><UploadFile v-model="info.ProjectProposal" :upName="upInfo.jyName" UploadFileName="ProjectProposal" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
              <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.ProjectProposal"></DownloadButton></Col>
            </td>
          </tr>
          <tr>
            <td>
              <Icon type="ios-medical" color="#ff6868" />
              项目坐标
            </td>
            <td colspan="3">
              <!-- <span v-if='linearBtn=="非线性工程"'>经度{{selectPoint.lat|cutFour}}，纬度{{selectPoint.lng|cutFour}}</span>
              <span v-else>起点：经度{{selectPoint.lat|cutFour}}，纬度{{selectPoint.lng|cutFour}}，终点：经度{{selectPoint.lat|cutFour}}，纬度{{selectPoint.lng|cutFour}}</span> -->
              <span v-if='linearBtn=="非线性工程"'>经度{{markers.length>0?markers[0].position.lng:0|cutFour}}，纬度{{markers.length>0?markers[0].position.lat:0|cutFour}}</span>
              <span v-if='linearBtn=="线性工程"'>起点：经度{{markers.length>0?markers[0].position.lng:0|cutFour}}，纬度{{markers.length>0?markers[0].position.lat:0|cutFour}}，终点：经度{{markers.length>1?markers[1].position.lng:0|cutFour}}，纬度{{markers.length>1?markers[1].position.lat:0|cutFour}}</span>
              <Button @click="mapClick" :disabled='viewOnly'>查看地图</Button>
              <span v-show="coordinate" style="color:red;font-size:12px;">项目坐标点不能为空，请选择坐标点!</span>
              <Modal
                width='90%'
                v-model="modalMap"
                @on-ok="coordinate = false"
                @on-cancel="mapCancel">
                <!-- <p slot="header" style="height:35px">
                  <span style="margin-right:100px">
                     
                     <label>搜索：<input id="diming" placeholder="请输入地名"></label>
                      <Button type="primary" @click="queding2">确定</Button>
                     <input id="lngs" placeholder="请输入经纬度">
                     <input id="lats" placeholder="请输入经纬度">
                      <Button type="primary" @click="queding">确定</Button>
                  </span>
                  <RadioGroup type='button' size='small' v-model="linearBtn" @on-change='mapSelect'>
                    <Radio label='非线性工程'></Radio>
                    <Radio label='线性工程'>线性工程</Radio>
                  </RadioGroup>
                   <RadioGroup type='button' size='small' >
                    <Button type="primary" @click="quanping">全屏显示</Button>
                  </RadioGroup>
                </p> -->
                <!-- <google-map map-type-id="hybrid" :center="center" :zoom="5" @rightclick="newMarker" style="height: 600px;">
                    <map-marker
                      :position="m.position"
                      :opacity="m.opacity"
                      :draggable="m.draggable"
                      :clickable='true'
                      @click="center=m.position"
                      v-for="(m,index) in markers"
                      :key="index">
                  </map-marker>
                </google-map> -->
                    <!-- <bm-view class="map"></bm-view> -->
                    
            </Modal>
            </td>
          </tr>
          <tr>
            <td rowspan="2">
              建设内容</td>
            <td colspan="3">
              <Table border style="overflow-x:none" highlight-row ref="selection" :columns="buildingContentListOption"
                :data="buildingContentList" class="tabsty" @on-row-click="getIndex"></Table>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <Button type="primary" @click="inputAdd('buildingContentList')" :disabled='viewOnly'>添加</Button>
              <Button type="error" @click="inputRemove('buildingContentList')" :disabled='viewOnly'>删除</Button>
            </td>
          </tr>
          <tr>
            <td rowspan="7" width="25%">
              公用工程</td>
            <td width="25%">供水方式</td>
            <td colspan="2">
              <Input v-model="publicProjectList.WaterSupplyMethod" :disabled='viewOnly'/>
            </td>
          </tr>
          <tr>
            <td width="25%">供电方式</td>
            <td colspan="2">
              <FormItem prop="PowerSupplyMethod">
                <Input v-model="publicProjectList.PowerSupplyMethod" :disabled='viewOnly'/>
              </FormItem>
            </td>
          </tr>
          <tr>
            <td rowspan="3">排水去向</td>
            <td colspan="2">排水：
              <RadioGroup v-model="publicProjectList.IsSewage">
                <Radio label="是" :disabled='viewOnly'>
                  <span>是</span>
                </Radio>
                <Radio label="否" :disabled='viewOnly'>
                  <span>否</span>
                </Radio>
              </RadioGroup>
            </td>
          </tr>
          <tr>
            <td style="text-align: left">纳污水体：
              <Input v-show="IsSewage" v-model="publicProjectList.SewageWater" :disabled='viewOnly'/>
            </td>
            </td>
            <td style="text-align: left">纳污水体功能：
              <Input v-show="IsSewage" v-model="publicProjectList.SewageWaterAbility" :disabled='viewOnly'/>
            </td>
          </tr>
          <tr>
            <td style="text-align: left">排污路径：
              <Input v-show="IsSewage" v-model="publicProjectList.SewagePath" :disabled='viewOnly'/>
            </td>
            <td style="text-align: left">污水处理厂：
              <Input v-show="IsSewage" v-model="publicProjectList.SewagePlant" :disabled='viewOnly'/>
            </td>
          </tr>
          <tr>
            <td>供热取暖
            </td>
            <td colspan="2">
              <FormItem prop="ProvideHeat">
                <Input v-model="publicProjectList.ProvideHeat" :disabled='viewOnly'/>
              </FormItem>
            </td>
          </tr>
          <tr>
            <td>燃料及供应方式</td>
            <td colspan="2">
              <FormItem prop="FuelSupply">
                <Input v-model="publicProjectList.FuelSupply" :disabled='viewOnly'/>
              </FormItem>
            </td>
          </tr>
          <tr>
            <td>
              劳动定员</td>
            <td>
              <FormItem prop="LaborQuota">
                <Input v-model="info.LaborQuota" :disabled='viewOnly'/>
              </FormItem>
            </td>
            <td>
              住宿：
              <!-- <RadioGroup @on-change="accommodation" v-model="info.Labor_stay"> -->
              <RadioGroup @on-change="accommodation" v-model="LaborStaySelect">
                <Row>
                <Col span="12">
                  <Radio label="yes" :disabled='viewOnly'>
                    <span>是</span>
                  </Radio>
                </Col>
                <Col span="12">
                  <Radio label="no" :disabled='viewOnly'>
                    <span>否</span>
                  </Radio>
                </Col>
                <Col span="24">
                  <Input size="small" v-show="personnel" v-model="info.LaborStay"/>
                </Col>
                </Row>
              </RadioGroup>
            </td>
            <td>食堂：
              <RadioGroup v-model="info.LaborCanteen">
                <Radio label="是" :disabled='viewOnly'>
                  <span>是</span>
                </Radio>
                <Radio label="否" :disabled='viewOnly'>
                  <span>否</span>
                </Radio>
              </RadioGroup>
            </td>
          </tr>
          <tr>
            <td>
              生产规模
            </td>
            <td>
              <FormItem prop="ProductionScale">
                <Input type="textarea" :autosize='true' v-model="info.ProductionScale" :disabled='viewOnly'/>
              </FormItem>
            </td>
            <td>
              生产工艺
            </td>
            <td>
              <FormItem prop="ProductionProcess">
                <Input type="textarea" :autosize='true' v-model="info.ProductionProcess" :disabled='viewOnly'/>
              </FormItem>
            </td>
          </tr>
          <tr>
            <td rowspan="2">
              生产设备情况
            </td>
            <td colspan="3">
              <!-- 99%改成100% -->
              <div style="width:100%;margin:auto;height:100%;">
                <Table border ref="selection" :columns="equipmentListOption" :data="equipmentList" class="tabsty"
                  @on-row-click="getIndex"></Table>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <Button type="primary" @click="inputAdd('equipmentList')" :disabled='viewOnly'>添加</Button>
              <Button type="error" @click="inputRemove('equipmentList')" :disabled='viewOnly'>删除</Button>
            </td>
          </tr>
          <tr>
            <td rowspan="2">
              周围敏感点情况</td>
            <td colspan="3">
              <!-- 99%改成100% -->
              <div style="width:100%;margin:auto;height:100%;">
                <!-- 待解决 -->
                <Table border style="overflow-x:hidden" ref="selection" :columns="pointsListOption" :data="pointsList" class="tabsty"
                  @on-row-click="getIndex"></Table>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <Button type="primary" @click="inputAdd('pointsList')" :disabled='viewOnly'>添加</Button>
              <Button type="error" @click="inputRemove('pointsList')" :disabled='viewOnly'>删除</Button>
            </td>
          </tr>
          <tr>
            <td rowspan="2">周围企业情况</td>
            <td colspan="3">
              <!-- 99%改成100% -->
              <div style="width:100%;margin:auto;height:100%;">
                <!-- 待解决 -->
                <Table border ref="selection" :columns="surroundCompanyListOption" :data="surroundCompanyList" class="tabsty"></Table>
              </div>
            </td>
          </tr>
          <tr>
            <td colspan="3">
              <Button type="primary" @click="inputAdd('surroundCompanyList')" :disabled='viewOnly'>添加</Button>
              <Button type="error" @click="inputRemove('surroundCompanyList')" :disabled='viewOnly'>删除</Button>
            </td>
          </tr>
          <tr>
            <td>
              场地现状</td>
            <td>
              <FormItem prop="SiteStatus">
                <Input v-model="info.SiteStatus" :disabled='viewOnly'/>
              </FormItem>
            </td>
            <td>原有污染情况</td>
            <td>
              <Input v-model="info.OrgPollutionSituation" type='textarea' :autosize="true" :disabled='viewOnly'/>
            </td>
          </tr>
          <tr>
            <td>
              群众对项目意见</td>
            <td>
              <Input v-model="info.MassesOpinions" type='textarea' :autosize="true"  :disabled='viewOnly'/>
            </td>
            <td>其他搜集到的资料</td>
            <td>
              <Col span="12"><UploadFile v-model="info.OtherCollectInfo" :upName="upInfo.otherInfo" UploadFileName="OtherCollectInfo" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
              <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.OtherCollectInfo"></DownloadButton></Col>
            </td>
          </tr>
          <tr>
            <td>
              项目合同
            </td>
            <td>
              <Col span="12"><UploadFile v-model="info.ProjectContract" :upName="upInfo.htName" UploadFileName="ProjectContract" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
              <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.ProjectContract"></DownloadButton></Col>
            </td>
            <td>项目委托书</td>
            <td>
              <Col span="12"><UploadFile v-model="info.ProjectTrustInstrument" :upName="upInfo.wtsName" UploadFileName="ProjectTrustInstrument" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
              <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.ProjectTrustInstrument"></DownloadButton></Col>
            </td>
          </tr>
          <tr>
            <td>
              现场存在的环境问题</td>
            <td>
              <Input v-model="info.SceneProblems" type='textarea' :autosize="true" :disabled='viewOnly'/>
            </td>
            <td>现场影像</td>
            <td>
              <Col span="12"><UploadFile v-model="info.LiveImage" :upName="upInfo.xcName" UploadFileName="LiveImage" :UploadFileId="$route.query.ProjectId" :isDisabled='viewOnly'/></Col>
              <Col span="12"><DownloadButton v-if="viewOnly" :downData="downloadInfo.LiveImage"></DownloadButton></Col>
            </td>
          </tr>
          <tr>
            <td>
              勘探人员</td>
            <td>
              <Input v-model="info.SurveyPersonnel" :disabled='viewOnly'/>
            </td>
            <td>勘探日期</td>
            <td>
              <Input v-model="info.SurveyDate" :disabled='viewOnly'/>
            </td>
          </tr>
        </table>
      </Form>
      <table width='100%' border="1" cellspacing="0" cellpadding="0">
        <tr style="text-align:center;line-height: 41px;">
          <Tooltip placement="right">
            <!-- tip提示 -->
              <span>项目周围环境概况图</span>
              <div slot="content">
                <p>请上传项目场地现状及四周照片，周围敏</p>
                <p>感点照片，技改，改扩建项目提供项目现</p>
                <p>有生产设施生产设施和环保设施照片</p>
              </div>
          </Tooltip>
        </tr>
        <tr>
          <td>
            <p id="ula-ls">请至少上传两张现场照片</p>
            <div id="upload-List">
              <div class="demo-upload-list" v-for="(item,index) in uploadList" :key='index'>
                <template v-if="item.status === 'finished'">
                  <img :src="item.url">
                  <div class="demo-upload-list-cover">
                    <Icon type="ios-eye-outline" @click.native="handleView(item.url)"></Icon>
                    <Icon v-if="!viewOnly" type="ios-trash-outline" @click.native="handleRemove(item)"></Icon>
                  </div>
                </template>
                <template v-else>
                  <Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
                </template>
              </div>
              <Upload ref="upload" 
                with-credentials
                :show-upload-list="false" 
                :default-file-list="defaultList" 
                :on-success="handleSuccess"
                :format="['jpg','jpeg','png']" 
                :max-size="20480" :on-format-error="handleFormatError" 
                :on-exceeded-size="handleMaxSize"
                :before-upload="handleBeforeUpload" 
                multiple type="drag" 
                :action="shishi"
                :data='imgUpload'
                style="display: inline-block;width:58px;">
                <div style="width: 58px;height:58px;line-height: 58px;">
                  <Icon type="ios-camera" size="20"></Icon>
                </div>
              </Upload>
              <Modal title="现场照片" v-model="visible">
                <img :src="imgName" v-if="visible" style="width: 100%">
              </Modal>
            </div>
          </td>
        </tr>
      </table>
      <Row type="flex" justify="space-between" class="topmargin">
        <Col span="4">
        <PrintButton v-if="flag" Url="print/printSurver" :Project_id="info.Id"></PrintButton>
        </Col>
        <Col span="4">
        <div style="float: right">
          <Button type="primary" @click="submit('save')" :disabled='viewOnly'>保存</Button>
          <Button type="primary" @click="submit('submit')" :disabled='viewOnly'>提交</Button>      
        </div>
        </Col>
      </Row>
      <StepBar :status="2" :viewOnly='viewOnly'/>
    </card>
  </div>
</template>
<script>
  // import * as VueGoogleMaps from 'vue2-google-maps'
  import libs from "../../../libs/uploads";
  export default {
    data() {
      // 手机号验证
      const validatePhone = (rule, value, callback) => {
        if (!value) {
          return callback(new Error("联系电话不能为空"));
        } else if (!/^((0\d{2,3}-\d{7,8})|(1([358][0-9]|4[579]|66|7[0135678]|9[89])[0-9]{8}))$/.test(value)) {
          callback(new Error("电话格式不正确"));
        } else {
          callback();
        }
      };
      // 邮编验证
    const validateMailCode = (rule, value, callback) => {
      if (!value) {
        callback();
      } else if (value) {
        if (!/^[0-9][0-9]{5}$/.test(value)) {
          callback(new Error("邮编格式不正确"));
        } else {
          callback();
        }
      }
    };
    const validateNum = (rule, value, callback) => {
      if (value) {
        if (!/^\d+(?=\.{0,1}\d+$|$)/.test(value)) {
          callback(new Error('请输入数字'));
        }else{
          return callback()
        }
      }else{
        return callback()
      }
    };
      return {
        zoom:6,
        input:{
          lng:116.3,
          lat:39.7
        },
        hpbol:false,
        modelMap:false,
        circlePath: {
          center: {
            lng: 116.3,
            lat: 39.7
          },
        },
        keyword: '',
        shishi:'',
        asbol: true,
        UserOrg:'',
        LaborStaySelect: '',    //住宿选择是或否
        imgUpload: {
          Id: this.$route.query.ProjectId,
          Key: 'ImgUrl'
        },
        linearBtn: '非线性工程',
        // 项目名称、建设单位、法人、联系人、联系电话留痕列表
        projectName: false,
        buildName: false,
        LegalPerson: false,
        Linkman: false,
        telnumberName: false,
        projectNameList: [], 
        buildNameList: [],  
        LegalPersonList: [],       
        LinkmanList: [],
        telnumberNameList: [],
        viewOnly: false,  // 允许查看
        Situation: [
          {
            value: '0',
            label: '是'
          },
          {
            value: '1',
            label: '否'
          }
        ],
        upInfo: {
          htName: "",
          wtsName: "",
          bgName: "",
          pfName: "",
          ysName: "",
          jcName: "",
          pmtName: "",
          tdName: "",
          ghName: "",
          lxName: "",
          jyName: "",
          xmpmtName: "",
          otherName: "",
          otherInfo: "",
          xcName: "",
        },
        model1: "",
        modalMap: false,    //  地图弹框
        markers: [],
        center: { lat: 45, lng: 83 },
        selectPoint: { lat: 0, lng: 0 },
        personnel: false,
        flag: false,
        oldNameShow: false,
        loading: true,
        pt2List: {},
        defaultList: [],
        imgName: "",
        visible: false,
        uploadList: [],
        IsSewage: true,
        /* 创建项目data */
        info: {},
        equipmentList: [],
        buildingContentList: [],
        pointsList: [],
        surroundCompanyList: [],
        // 公用工程
        publicProjectList: {},
        allIndex: "",
        // 验证
        rules: {
           MailZipCode: [
          { validator: validateMailCode, trigger: "blur" }
        ],
        FloorSpace: [
          { validator: validateNum, trigger: 'blur' }
        ],
        GreenSpace: [
          { validator: validateNum, trigger: 'blur' }
        ],
        TotalInvestment: [
          { validator: validateNum, trigger: 'blur' }
        ],
        ContractAmount: [
          { validator: validateNum, trigger: 'blur' }
        ],
          ProjectName: {
            required: true,
            trigger: "blur",
            message: "项目名称不能为空"
          },
          BuildUnit: {
            required: true,
            trigger: "blur",
            message: "建设单位不能为空"
          },
          LegalPerson: {
            required: true,
            trigger: "blur",
            message: "法人不能为空"
          },
          Linkman: {
            required: true,
            trigger: "blur",
            message: "联系人不能为空"
          },
          MailAddress: {
            required: true,
            trigger: "blur",
            message: "通讯地址不能为空"
          },
          TelNumber: [
            { validator: validatePhone, trigger: "blur" }
          ],
          BuildAreaCode: {
            required: true,
            trigger: "blur",
            message: "建设地点不能为空"
          },
          
        },
        //建设内容
        buildingContentListOption: [{
            type: "index",
            width: 60,
            align: "center"
          },
          {
            title: "建筑名称",
            key: "BuildingName",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.BuildingName
                },
                on: {
                  "on-blur": val => {
                    this.buildingContentList[index][
                      "ProjectId"
                    ] = this.$route.query.ProjectId;
                    this.buildingContentList[index].BuildingName =
                      val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "建筑面积、数量、结构、层数、功能等",
            key: "Content",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Content
                },
                on: {
                  "on-blur": val => {
                    if(!this.buildingContentList[index].BuildingName){
                      this.buildingContentList[index][
                      "ProjectId"
                      ] = this.$route.query.ProjectId;
                    }
                    this.buildingContentList[index].Content = val.target.value;
                  }
                }
              });
            }
          }
        ],
        // 生产设备情况
        equipmentListOption: [{
            type: "index",
            width: 60,
            align: "center"
          },
          {
            title: "设备名称",
            key: "Equipment",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Equipment
                },
                on: {
                  "on-blur": val => {
                    this.equipmentList[index][
                      "ProjectId"
                    ] = this.$route.query.ProjectId;
                    this.equipmentList[index].Equipment = val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "数量",
            key: "Model",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Quantity
                },
                on: {
                  "on-blur": val => {
                    if(!this.equipmentList[index].Equipment){
                      this.equipmentList[index][
                      "ProjectId"
                     ] = this.$route.query.ProjectId;
                    }
                    this.equipmentList[index].Quantity = val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "规格型号",
            key: "Model",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Model
                },
                on: {
                  "on-blur": val => {
                    if(!this.equipmentList[index].Equipment && !this.equipmentList[index].Quantity){
                      this.equipmentList[index][
                      "ProjectId"
                     ] = this.$route.query.ProjectId;
                    }
                    this.equipmentList[index].Model = val.target.value;
                  }
                }
              });
            }
          }
        ],
        // 周围企业情况
        surroundCompanyListOption: [{
            type: "index",
            width: 60,
            align: "center"
          },
          {
            title: "企业名称",
            key: "Company",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Company
                },
                on: {
                  "on-blur": val => {
                    this.surroundCompanyList[index][
                      "ProjectId"
                    ] = this.$route.query.ProjectId;
                    this.surroundCompanyList[index].Company = val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "方位/距离m ",
            key: "ScDistance",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.ScDistance
                },
                on: {
                  "on-blur": val => {
                    if(!this.surroundCompanyList[index].Company){
                      this.surroundCompanyList[index][
                      "ProjectId"
                      ] = this.$route.query.ProjectId;
                    }
                    this.surroundCompanyList[index].ScDistance =
                      val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "从事生产",
            key: "Engage",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Engage
                },
                on: {
                  "on-blur": val => {
                    if(!this.surroundCompanyList[index].Company && !this.surroundCompanyList[index].ScDistance){
                      this.surroundCompanyList[index][
                      "ProjectId"
                      ] = this.$route.query.ProjectId;
                    }
                    this.surroundCompanyList[index].Engage = val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "排污情况",
            key: "Discharge",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Discharge
                },
                on: {
                  "on-blur": val => {
                    if(!this.surroundCompanyList[index].Company && !this.surroundCompanyList[index].ScDistance && !this.surroundCompanyList[index].Engage){
                      this.surroundCompanyList[index][
                      "ProjectId"
                      ] = this.$route.query.ProjectId;
                    }
                    this.surroundCompanyList[index].Discharge = val.target.value;
                  }
                }
              });
            }
          }
        ],
        // 周围敏感点情况
        pointsListOption: [{
            type: "index",
            width: 60,
            align: "center"
          },
          {
            title: "敏感点名称",
            key: "SensitiveName",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.SensitiveName
                },
                on: {
                  "on-blur": val => {
                    this.pointsList[index][
                      "ProjectId"
                    ] = this.$route.query.ProjectId;
                    this.pointsList[index].SensitiveName = val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "方位/距离m",
            key: "Distance",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Distance
                },
                on: {
                  "on-blur": val => {
                    if(!this.pointsList[index].SensitiveName){
                      this.pointsList[index][
                      "ProjectId"
                      ] = this.$route.query.ProjectId;
                    }
                    this.pointsList[index].Distance = val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "户数/人口（人）",
            key: "Households",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.Households
                },
                on: {
                  "on-blur": val => {
                    if(!this.pointsList[index].SensitiveName && !this.pointsList[index].Distance){
                      this.pointsList[index][
                      "ProjectId"
                      ] = this.$route.query.ProjectId;
                    }
                    this.pointsList[index].Households = val.target.value;
                  }
                }
              });
            }
          },
          {
            title: "环境功能区及级别",
            key: "EnvFunLevel",
            render: (h, {
              row,
              index
            }) => {
              return h("Input", {
                props: {
                  type: "text",
                  value: row.EnvFunLevel
                },
                on: {
                  "on-blur": val => {
                    if(!this.pointsList[index].SensitiveName && !this.pointsList[index].Distance && !this.pointsList[index].Households){
                      this.pointsList[index][
                      "ProjectId"
                      ] = this.$route.query.ProjectId;
                    }
                    this.pointsList[index].EnvFunLevel = val.target.value;
                  }
                }
              });
            }
          }
        ],
        whether: "yes",
        downloadInfo: {},
        coordinate: false,
        updatedInfo: 0,
        setButton: 0,
      };
    },
    // 地图组件
    // components: {
    //     'googleMap': VueGoogleMaps.Map,
    //     'MapMarker': VueGoogleMaps.Marker
    // },
    created() {
      //判断是否有ID
      if (this.$route.query.ProjectId && this.$route.query.ProjectId != "") {
        this.getProject(this.$route.query.ProjectId || this.$route.query.id);
        if(this.$route.query.viewOnly==1 || localStorage.getItem('userOrg') ==7) {
          this.viewOnly = true
        }
      } else {
        //跳转首页
        this.$router.push({
          name: "index"
        });
      }
    },
    mounted() {
      // console.log(this.uploadList)
      this.viewUploadPic();
      this.UserOrg = localStorage.getItem('userOrg');
      this.shishi = libs.uploads1();

    },
    filters: {
      // 坐标点保留后4位
      cutFour: function (value) {
        if (!value) return value
        value = value.toString()
        return value.substring(0,value.indexOf(".")+5)
      }
    },
    watch: {
      "info.LaborStay"() {
        if(this.info.LaborStay) {
          this.LaborStaySelect = 'yes'
          this.personnel = true
        }else {
          this.LaborStaySelect = 'no'
          this.personnel = false
        }
      },
      "publicProjectList.IsSewage"(){
        if(this.publicProjectList.IsSewage == '是'){
          this.IsSewage = true
        }else{
          this.IsSewage = false
          this.publicProjectList.SewageWater = ''
          this.publicProjectList.SewageWaterAbility = ''
          this.publicProjectList.SewagePath = ''
          this.publicProjectList.SewagePlant = ''
        }
      }
    },
    methods: {
      mapClick(){
        this.modelMap = true
        this.center.lng = this.markers.length>0?this.markers[0].position.lng:null
        this.center.lat = this.markers.length>0?this.markers[0].position.lat:null
        console.log(this.center)
        this.circlePath.center.lng = this.center.lng
        this.circlePath.center.lat = this.center.lat
        this.input.lng = this.center.lng
        this.input.lat = this.center.lat
       
        setTimeout(()=>{
          this.queding()
          console.log(123)
        },100)
      },
      queding(){
        var widths = document.getElementById("lngs").value;
        var quan = document.getElementById("lats").value; 
        // this.syncCenterAndZoom(widths,quan)
        this.circlePath.center.lng = widths?widths:116.3;
        this.circlePath.center.lat = quan?quan:39.7;
        this.center.lng = widths?widths:116.3
        this.center.lat = quan?quan:39.7
        this.hpbol = true;
        this.markers[0].position.lat = this.center.lat
        this.markers[0].position.lng = this.center.lng
      },
      queding2(){
        var widths = document.getElementById("diming").value;
        this.keyword = widths;
      },
      // 搜索
      syncCenterAndZoom (e) {
       
        // this.center.lng = widths
        // this.center.lat = quan
        // const {lng, lat} = e.target.getCenter()
        // this.center.lng = lng
        // this.center.lat = lat
        // this.circlePath.center.lng = this.center.lng
        // this.circlePath.center.lat = this.center.lat
        // this.markers.length>0?this.markers[0].position.lng = this.center.lng:0
        // this.markers.length>0?this.markers[0].position.lat = this.center.lat:0
        
        // this.zoom = e.target.getZoom()
      },
      quanping(){
        var widths = document.getElementById("allmap");
        var quan = document.getElementById("quan");
        widths.style.width = document.body.clientWidth + "px";
        widths.style.height = document.body.clientHeight + "px";
        widths.classList.add("quanping");
        quan.style.display = "block";
        console.log(widths.style.width);
      }, 
      tuichu(){
        var widths = document.getElementById("allmap");
        var quan = document.getElementById("quan");
        widths.classList.remove("quanping");
        quan.style.display = "none";
        widths.style.width = 100 + "%";
        widths.style.height = 600 + "px";
      },
      // 回显图片
      viewUploadPic() {
        this.$post('/wechatpublic/findImg',{
          Id: this.$route.query.ProjectId
        }).then(res=>{
          if(res.data!=undefined&&res.data.length>0) {
            var data = res.data
            this.defaultList = []
            data.forEach(e=>{
              if(e.Status == null){
                this.defaultList.push({
                  name: 'img1.jpg',
                  url: e.ImgUrl,
                  Id: e.Id,
                }) 
              }
            })  
            console.log(this.defaultList.length);
            this.$nextTick(()=>{
              this.uploadList = this.$refs.upload.fileList;
            })
            if(this.defaultList.length > 1){
              this.asbol = false;
               console.log('1');
            }
          }
        }).catch(err=>{
          console.log(err)
        })
      },
      accommodation(event){
        if(event == 'yes'){
          this.personnel = true
        }else{
          this.info.LaborStay = ''
          this.personnel = false
        }
      },
      mapSelect() {
        this.markers=[]
      },
      // 名字去重显示
      viewClick(e,nameShow) {
        if(!this[nameShow]) {
          e.target.className = 'ivu-icon ivu-icon-ios-arrow-up'
        }else {
          e.target.className = 'ivu-icon ivu-icon-ios-arrow-down'
        }
        this[nameShow] = !this[nameShow]
      },
      newMarker (mouseArgs) {
        const createdMarker = this.addMarker()
        createdMarker.position.lat = mouseArgs.point.lat;
        createdMarker.position.lng = mouseArgs.point.lng;
        console.log(mouseArgs.point.lat)
        // this.selectPoint = { lat: createdMarker.position.lat, lng: createdMarker.position.lng }
        // this.info.Project_coordinates = this.selectPoint.lat+','+ this.selectPoint.lng
        // console.log(createdMarker.position.lat, createdMarker.position.lng)
      },
      addMarker () {
        if(this.linearBtn=='非线性工程') {
          this.markers=[{
            position: { lat: 39, lng: 116 },
            draggable: false,
            enabled: false
          }]
          // console.log(this.markers)
          return this.markers[this.markers.length - 1]
        }else {
          if(this.markers.length>1) {
            this.markers[1]={
              position: { lat: 39, lng: 116 },
              draggable: false,
              enabled: false
            }
            return this.markers[1]
          }else {
            this.markers.push({
              position: { lat: 39, lng: 116 },
              draggable: false,
              enabled: false
            })
            return this.markers[this.markers.length - 1]
          }
        }
      },
      mapCancel() {
        this.markers = []
        this.linearBtn=='非线性工程'
        this.selectPoint = { lat: 0, lng: 0 }
      },
      handleView(name) {
        this.imgName = name;
        this.visible = true;
      },
      handleRemove(file) {
        // const fileList = this.$refs.upload.fileList;
        // this.$refs.upload.fileList.splice(fileList.indexOf(file), 1);
        axios.post('/wechatpublic/deleteByImg',{
          Id: file.Id
        }).then(res=>{
          if(this.UserOrg==7){
            return this.$Message.success('无权操作！')
          }else if(res._STATUS==1) {
              this.$Message.success('删除成功1！')
              const fileList = this.$refs.upload.fileList;
              this.$refs.upload.fileList.splice(fileList.indexOf(file), 1);
              console.log(this.$refs.upload.fileList.length);
              if(this.$refs.upload.fileList.length < 2){
                this.asbol = true;
              }
            }
        }).catch(err=>{
          console.log(err)
        })
      },
      handleSuccess(res1, file,fileList) {
        console.log(res1, file,fileList)
        debugger
        let sum = 0
        fileList.forEach((e,index)=>{
          let size = e.size?e.size:0
          sum = sum + size
        })
        console.log(sum)
        if(sum<1048576){
            setTimeout(()=>{
              this.refeshLish()
            },1000)
        }
        if(sum>1048576&&sum<5242880){
            setTimeout(()=>{
              this.refeshLish()
            },3000)
        }
        if(sum>5242880){
            setTimeout(()=>{
              this.refeshLish()
            },4500)
        }
    
        
       
      },
      refeshLish(){
           this.$post('/wechatpublic/findImg',{
          Id: this.$route.query.ProjectId
        }).then(res=>{
          if(res.data!=undefined&&res.data.length>0) {
            var data = res.data
            this.defaultList = []
            data.forEach(e=>{
              if(e.Status == null){
                this.defaultList.push({
                  name: 'img1.jpg',
                  url: e.ImgUrl,
                  Id: e.Id,
                }) 
              }
            })  
            this.$nextTick(()=>{
              this.uploadList = this.$refs.upload.fileList;
            })
            if(this.defaultList.length > 1){
              this.asbol = false;
            }
          }
        }).catch(err=>{
          console.log(err)
        })
       
      },
      handleFormatError(file) {
        this.$Notice.warning({
          title: "文件格式不正确",
          desc: "只能上传图片格式，支持jpg、jpeg、png"
        });
      },
      handleMaxSize(file) {
        this.$Notice.warning({
          title: "图片大小限制",
          desc: "上传图片大小不能超过20M!"
        });
      },
      handleBeforeUpload() {
        if(this.UserOrg==7 || this.$route.query.viewOnly==1){
          return false;
        }
        const check = this.uploadList.length < 15;
        if (!check) {
          this.$Notice.warning({
            title: "最多支持上传15张！"
          });
        }
        return check;
      },
      inputRemove(type) {
        this[type].splice(this.allIndex, 1);
        // console.log(this[type] + ' 被删除了')
      },
      getIndex(data, index, event) {
        this.allIndex = index;
      },
      //点击添加意见
      inputAdd(type) {
        this[type].push({});
      },
      //建筑内容
      buildingContentListFn() {
        let BuildingContentList = this.buildingContentList;
        console.log(BuildingContentList)
        return axios.post("/buildingcontent/saveOrUpdate", {
          BuildingContentList: JSON.stringify(BuildingContentList)
        });
      },
      //机器
      productEquipmentListFn() {
        let productEquipmentList = this.equipmentList;
        console.log(productEquipmentList)
        return axios.post("/productEquipment/saveOrUpdateProductEquipment", {
          ProductEquipmentList: JSON.stringify(productEquipmentList)
        });
      },
      //敏感
      sensitivePointsListFn() {
        let sensitivePointsList = this.pointsList;
        return axios.post("/sensitivePoints/addOrUpdate", {
          SensitivePointsList: JSON.stringify(sensitivePointsList)
        });
      },
      //周围
      surroundCompanyListFn() {
        let surroundCompanyList = this.surroundCompanyList;
        return axios.post("/surroundCompany/saveOrUpdate", {
          SurroundCompanyList: JSON.stringify(surroundCompanyList)
        });
      },
      // 公用工程
      publicProjectListFn() {
        let publicProjectList = this.publicProjectList
        publicProjectList["ProjectId"] = this.$route.query.ProjectId;
        publicProjectList = new Array(publicProjectList)
        return axios.post('/publicProject/saveOrUpdatePublicProject', {
          PublicProjectList: JSON.stringify(publicProjectList)
        })
      },
      // 保存 save / 提交 submit
      submit(type) {
        if(!this.markers.length>0) {
          this.coordinate = true
          document.documentElement.scrollTop=380
          return 
        }else{
          this.coordinate = false
        }

        if(type == 'save'){
          if(!this.asbol){
            if(this.setButton == 0){
              // 验证
              this.$refs.form.validate(valid => {
                if (!valid) {
                  return
                }
                this.setButton = 1
                setTimeout(()=>{this.setButton = 0},60000)
                let info = this.info;
                console.log(this.info)
                info.BtnWay = type == "save" ? 1 : 2;
                info.PerjectType = type == "save" ? 3 : 3;
                if(this.linearBtn=="非线性工程") {
                  this.info.ProjectCoordinates = this.markers[0].position.lat+','+ this.markers[0].position.lng
                }else {
                  this.info.ProjectCoordinates = this.markers[0].position.lat+','+ this.markers[0].position.lng +','+ this.markers[1].position.lat+','+ this.markers[1].position.lng
                }
                axios.post('/projectInformation/saveOrUpdateProject', info).then((res) => {
                  if (res._STATUS == 1) {
                    let title = res._MESSAGE
                    if (type == 'save') {
                      this.$Modal.success({
                        title,
                      })
                    } else {
                      this.$router.push({
                        name: "environmentQuality",
                        query: {
                          ProjectId: this.$route.query.ProjectId
                        }
                      })
                    }
                  } else {
                    // 提示
                    this.$Modal.error({
                      title: res._MESSAGE
                    })
                  }
                })
                axios.all([this.buildingContentListFn(), this.productEquipmentListFn(), this.sensitivePointsListFn(),
                  this.surroundCompanyListFn(), this.publicProjectListFn()
                ]).then(axios.spread(function (buildingContentList, productEquipmentList, sensitivePointsList,
                  surroundCompanyList, publicProjectList) {
                }))
              });
          }else{
            this.$Message.warning('连续点击保存时间过短，最少间隔1分钟!')
          }
          }else{
            this.$Message.warning('至少上传两张现场照片');
          }
        }else{
          if(!this.asbol){
            if(this.updatedInfo == 0){
              // 验证
              this.$refs.form.validate(valid => {
                if (!valid) {
                  return
                }
                this.updatedInfo = 1
                setTimeout(()=>{this.updatedInfo = 0},60000)
                let info = this.info;
                info.BtnWay = type == "save" ? 1 : 2;
                info.PerjectType = type == "save" ? 3 : 3;
                if(this.linearBtn=="非线性工程") {
                  this.info.ProjectCoordinates = this.markers[0].position.lat+','+ this.markers[0].position.lng
                }else {
                  this.info.ProjectCoordinates = this.markers[0].position.lat+','+ this.markers[0].position.lng +','+ this.markers[1].position.lat+','+ this.markers[1].position.lng
                }
                axios.post('/projectInformation/saveOrUpdateProject', info).then((res) => {
                  if (res._STATUS == 1) {
                    let title = res._MESSAGE
                    if (type == 'save') {
                      this.$Modal.success({
                        title,
                      })
                    } else {
                      this.$router.push({
                        name: "environmentQuality",
                        query: {
                          ProjectId: this.$route.query.ProjectId
                        }
                      })
                    }
                  } else {
                    // 提示
                    this.$Modal.error({
                      title: res._MESSAGE
                    })
                  }
                })
                axios.all([this.buildingContentListFn(), this.productEquipmentListFn(), this.sensitivePointsListFn(),
                  this.surroundCompanyListFn(), this.publicProjectListFn()
                ]).then(axios.spread(function (buildingContentList, productEquipmentList, sensitivePointsList,
                  surroundCompanyList, publicProjectList) {
                }))
              });
            }else{
              this.$Message.warning('连续点击提交时间过短，最少间隔1分钟!')
            }
        }else{
            this.$Message.warning('请至少上传两张现场照片')
        }
        }

      },
      /* 获取当前创建项目 */
      getProject(Id) {
        this.$post('ProjectInfo.findProjectByID', {
              Id,
              Economy: 'Economy'
          })
          .then(res => {
            this.downloadInfo = res.doc
            this.info = res.info;
            if(res.info.ProjectCoordinates) {
              var selectPoint = this.info.ProjectCoordinates.split(',')
              if(selectPoint.length>0&&selectPoint.length<3) {
                this.linearBtn='非线性工程'
                this.markers.push({position: { lat: parseFloat(selectPoint[0]), lng: parseFloat(selectPoint[1]) },})
              }else if(selectPoint.length>2){
                this.linearBtn='线性工程'
                this.markers.push({position: { lat: parseFloat(selectPoint[0]), lng: parseFloat(selectPoint[1]) },})
                this.markers.push({position: { lat: parseFloat(selectPoint[2]), lng: parseFloat(selectPoint[3]) },})
              }
              // this.selectPoint = { lat: selectPoint[0], lng: selectPoint[1] }
            } 

            // 项目名字留痕
            if(res.pt2List.length>0) {
              var arrAll = res.pt2List //所有更改记录
              function arrayUnique2(arr, ProjectName) {
                var hash = {};
                return arr.reduce(function (item, next) {
                  hash[next[ProjectName]] ? '' : hash[next[ProjectName]] = true && item.push(next);
                  return item;
                }, []);
              }
              var projectNameList = arrayUnique2(arrAll, "ProjectName")
              if(projectNameList[0].ProjectName==this.info.ProjectName) {
                projectNameList = arrayUnique2(arrAll, "ProjectName").slice(1)
              }
              projectNameList.forEach(e => {
                this.projectNameList.push({name: e.ProjectName,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });

              var buildNameList = arrayUnique2(arrAll, "BuildUnit")
              if(buildNameList[0].BuildUnit==this.info.BuildUnit) {
                buildNameList = arrayUnique2(arrAll, "BuildUnit").slice(1)
              }
              buildNameList.forEach(e => {
                this.buildNameList.push({name: e.BuildUnit,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });
              
              var LegalPersonList = arrayUnique2(arrAll, "LegalPerson")
              if(LegalPersonList[0].LegalPerson==this.info.LegalPerson) {
                LegalPersonList = arrayUnique2(arrAll, "LegalPerson").slice(1)
              }
              LegalPersonList.forEach(e => {
                this.LegalPersonList.push({name: e.LegalPerson,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });

              var LinkmanList =  arrayUnique2(arrAll, "Linkman")
              if(LinkmanList[0].Linkman==this.info.Linkman) {
                LinkmanList =  arrayUnique2(arrAll, "Linkman").slice(1)
              }
              LinkmanList.forEach(e => {
                this.LinkmanList.push({name: e.Linkman,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });

              var telnumberNameList = arrayUnique2(arrAll, "TelNumber")
              if(telnumberNameList[0].TelNumber==this.info.TelNumber) {
                telnumberNameList = arrayUnique2(arrAll, "TelNumber").slice(1)
              }
              telnumberNameList.forEach(e => {
                this.telnumberNameList.push({name: e.TelNumber,Operator: e.Operator,UpdateTime: e.UpdateTime})
              });            
            }
            this.equipmentList = res.equipmentList;
            this.buildingContentList = res.buildingContentList;
            this.pointsList = res.pointsList;
            this.surroundCompanyList = res.surroundCompanyList;
            if (!res.publicProjectList[0]) {
              this.publicProjectList = {}
            } else {
              this.publicProjectList = res.publicProjectList[0]
            }
            localStorage.projectType = this.info.PerjectType
            this.loading = false
            this.flag = true
            this.upInfo.htName = this.upWord(res.doc.ProjectContract)
            this.upInfo.wtsName = this.upWord(res.doc.ProjectTrustInstrument)
            this.upInfo.bgName = this.upWord(res.doc.OrgEiaReport)
            this.upInfo.pfName = this.upWord(res.doc.OrgEiaReply)
            this.upInfo.ysName = this.upWord(res.doc.OrgProjectAcceptanceDoc)
            this.upInfo.jcName = this.upWord(res.doc.OrgProjectMonitoringDoc)
            this.upInfo.pmtName = this.upWord(res.doc.FactoryFlatMap)
            this.upInfo.tdName = this.upWord(res.doc.LandDoc)
            this.upInfo.ghName = this.upWord(res.doc.PlanningDoc)
            this.upInfo.lxName = this.upWord(res.doc.CreateProjectDoc)
            this.upInfo.jyName = this.upWord(res.doc.ProjectProposal)
            this.upInfo.xmpmtName = this.upWord(res.doc.ProjectFlatMap)
            this.upInfo.otherName = this.upWord(res.doc.ProjectOtherDoc)
            this.upInfo.otherInfo = this.upWord(res.doc.OtherCollectInfo)
            this.upInfo.xcName = this.upWord(res.doc.LiveImage)
          })
          .catch(err => {
            console.log(err)
            // alert("请求崩溃");
          });
      },
      handerUpload(file) {
        this.file = file;
      },
      upWord(url){        //分割字符串
        if(url == null){
          return '上传'
        }else{
          var upWord = url;
          upWord = upWord.split("/");
          upWord = upWord.slice(-1);
          upWord = upWord.join('');
          // console.log(upWord)
          return upWord
        }
      },
    },
  };
</script>
<style lang="less">
.out-div{
  // background-color: gray;
  border-radius: 5px;
   box-shadow:black 0px 0px 30px
}
.tuichu{
    position: absolute;
    right: 30px;
    top: 25%;
    width: 80px;
    height: 20px;
    background: #fff;
    text-align: center;
    border-radius: 3px;
    border: 1px solid #eee;
    z-index: 1000;
    display: none;
  }
  .quanping{
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999;
  }
  .topmargin {
    margin-top: 10px;
  }
  .map{
    display: none;
  }
  #reconnaissanceTrip {
    td.sizeStyle {
      font-size:12px;
    }
    textarea.ivu-input {
      font-size: 12px;
    }
    .ivu-input {
      border: none !important;
      text-align: center;

      input {
        outline: medium;
      }
    }
    .ivu-table-tip{
      overflow-x: hidden;
    }
    .ivu-input[disabled], fieldset[disabled] .ivu-input {
      background-color: #fff; 
      color: #333;
      font-size: 12px;
    }
    .ivu-select-disabled .ivu-select-selection {
      background-color: #fff;
      color: #333;
      border: 0;
    }
  }
  #allmap{
    height: 600px;
  }
  #upload-List {
    .demo-upload-list {
      display: inline-block;
      width: 60px;
      height: 60px;
      text-align: center;
      line-height: 60px;
      border: 1px solid transparent;
      border-radius: 4px;
      overflow: hidden;
      background: #fff;
      position: relative;
      box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
      margin-right: 4px;
    }

    .demo-upload-list img {
      width: 100%;
      height: 100%;
    }
    .demo-upload-list-cover {
      display: none;
      position: absolute;
      top: 0;
      bottom: 0;
      left: 0;
      right: 0;
      background: rgba(0, 0, 0, 0.6);
    }

    .demo-upload-list:hover .demo-upload-list-cover {
      display: block;
    }

    .demo-upload-list-cover i {
      color: #fff;
      font-size: 20px;
      cursor: pointer;
      margin: 0 2px;
    }
  }
</style>
